package ru.java2D;

import java.awt.*;
import javax.swing.*;

/**
 * Created with IntelliJ IDEA.
 * User: Admin
 * Date: 02.05.13
 * Time: 12:24
 * To change this template use File | Settings | File Templates.
 */
public class Enemy {
    int x;
    int y;
    int length = 172;
    int width = 100;
    int v;
    Image img = new ImageIcon (getClass().getClassLoader().getResource("res/pz3.jpg")).getImage();
    Road road;

    public Rectangle getRect(){
        return new Rectangle(x, y, length, width);
    }

    public Enemy (int x, int y, int v, Road road){
        this.x = x;
        this.y = y;
        this.v = v;
        this.road = road;
    }

    public void move(){
        x = x - road.p.v + v;
    }
}
